package com.conrradocamacho.carmen.adapter;

import com.conrradocamacho.carmen.R;
import com.conrradocamacho.carmen.dao.model.Missao;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MissaoAdapter extends BaseAdapter {
	
	protected Activity 				activity;
	private Missao 			missaoDetalhe;
	
	public MissaoAdapter(Activity activity, Missao missaoDetalhe) {
		this.activity = activity;
		this.missaoDetalhe = missaoDetalhe;
	}
	
	@Override
	public int getCount() {
		return 1;
	}

	@Override
	public Object getItem(int arg0) {
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return 0;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View vi = convertView;
		
		if (vi == null) {
			LayoutInflater inflater = activity.getLayoutInflater();
			vi = inflater.inflate(R.layout.item_missao, parent);
		}
		
		((TextView) vi.findViewById(R.id.textNome)).setText(missaoDetalhe.getNome());
		//((ImageView) vi.findViewById(R.id.imageMissao)).setText(listMissao.get(position).getImagem());
		((TextView) vi.findViewById(R.id.textDecricao)).setText(missaoDetalhe.getDescricao());
		
		return vi;
	}

}
